<%--
  Created by IntelliJ IDEA.
  User: ljh
  Date: 2024/9/25
  Time: 20:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored ="false" %>
<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新手指引</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/driver.js@1.0.1/dist/driver.css"/>
</head>
<body>
<h1 id="h1">新手指引</h1>
<h2 id="sb1">第一步</h2>
<p>
    随机文字随机文字随机文字随机文字随机文字随机文字随机文字随机文字，<br>
    随机文字随机文字随机文字随机文字随机文字随机文字随机文字随机文字，<br>
    随机文字随机文字随机文字随机文字随机文字随机文字随机文字随机文字，<br>
    随机文字随机文字随机文字随机文字随机文字随机文字随机文字随机文字，<br>
    随机文字随机文字随机文字随机文字随机文字随机文字随机文字随机文字，<br>
    随机文字随机文字随机文字随机文字随机文字随机文字随机文字随机文字，<br>
</p>
<h2 id="sb2">第二步</h2>
<p>
    肚子饿了，晚上没吃饭，<br>
    肚子饿了，晚上没吃饭，<br>
    肚子饿了，晚上没吃饭，<br>
    肚子饿了，晚上没吃饭，<br>
    肚子饿了，晚上没吃饭，<br>
    肚子饿了，晚上没吃饭，<br>
    肚子饿了，晚上没吃饭，<br>
</p>
<h2 id="sb3">第三步</h2>
<p>
    晚上要去吃点夜宵，<br>
    晚上要去吃点夜宵，<br>
    晚上要去吃点夜宵，<br>
    晚上要去吃点夜宵，<br>
    晚上要去吃点夜宵，<br>
    晚上要去吃点夜宵，<br>
</p>

<script src="https://cdn.jsdelivr.net/npm/driver.js@1.0.1/dist/driver.js.iife.js"></script>
<c:if test="${isNewUser}">
<script>
    const driver = window.driver.js.driver;

    const driverObj = driver({
            showProgress: true,
            allowClose: false,
            steps: [
                { element: '#sb1', popover: { title: '万事开头难', description: '大胆跨出第一步', side: "bottom", align: 'start' }},
                { element: '#sb2', popover: { title: 'Import the Library', description: 'It works the same in vanilla JavaScript as well as frameworks.', side: "bottom", align: 'start' }},
                { element: '#sb3', popover: { title: 'Importing CSS', description: 'Import the CSS which gives you the default styling for popover and overlay.', side: "top", align: 'start' }},
                { popover: { title: 'Happy Coding', description: 'And that is all, go ahead and start adding tours to your applications.' } }
            ],
            // onDestroyStarted is called when the user tries to exit the tour
            onDestroyStarted: () => {
                if (!driverObj.hasNextStep() || confirm("Are you sure?")) {
                    driverObj.destroy();
                }
            },
            onDestroyed: () => {
                window.location="http://localhost:8080/am_web2_war/product-tours-add-cookie";
            }
    });

    driverObj.drive();
</script>
</c:if>


</body>
</html>